//package com.example.myvideo.presenter;
//
//import android.content.ContentValues;
//import android.database.sqlite.SQLiteDatabase;
//import android.net.Uri;
//
//import com.example.myvideo.contract.VideoAppView;
//import com.example.myvideo.database.DBHelper;
//
//import java.io.File;
//import java.io.IOException;
//
//public class VideoAppPresenter {
//
//    private VideoAppView view;
//    private DBHelper dbHelper;
//    private FileOperations fileOperations;
//
//    public VideoAppPresenter(VideoAppView view) {
//        this.view = view;
//        dbHelper = new DBHelper(view.getContext());
//        fileOperations = new FileOperations(view.getContext());
//    }
//
//    public void uploadVideo(Uri videoUri, String title, String description, String userId) {
//        try {
//            File videoFile = fileOperations.createVideoFile();
//            fileOperations.saveFile(videoUri, videoFile);
//            // Insert video record into database
//            SQLiteDatabase db = dbHelper.getWritableDatabase();
//            ContentValues values = new ContentValues();
//            values.put("title", title);
//            values.put("description", description);
//            values.put("video_path", videoFile.getAbsolutePath());
//            values.put("user_id", userId);
//            db.insert("videos", null, values);
//            view.showVideoUploaded();
//        } catch (IOException e) {
//            view.showError("Error uploading video: " + e.getMessage());
//        }
//    }
//
//    // Other presenter methods...
//}